<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script src="./emitter-v2.js"></script>
  <script>
    var emitter = new EventEmitter();
    function handleOne(a, b, c) {
      console.log('fn1', a, b, c);
    }
    function handleSecond(a, b, c) {
      console.log('fn2', a, b, c);
    }
    function handleThird(a, b, c) {
      console.log('fn3', a, b, c);
    }
    emitter.on('demo', handleOne)
      .on('demo', handleSecond)
      .on('demo', handleThird);

    emitter.emit('demo', [1, 2, 3]);

    emitter.off('demo', handleThird);
    emitter.emit('demo', [1, 2, 3]);
  </script>
</body>

</html>